import request from "@/utils/request";

export function addSummary(data) {
  return request({
    url: '/summary/save',
    method: 'POST',
    data
  })
}

export function dailyContent(query) {
  return request({
    url: '/summary/day-summary',
    method: 'post',
    params: query
  })
}

//首页一个月存在日报的列表
export function monthContent(query) {
  return request({
    url: '/summary/monthlist',
    method: 'get',
    params: query
  })
}

export function updateDaily(data) {
  return request({
    url: "/summary/update",
    method: 'post',
    data
  })
}

// 获取某月月报信息
export function getMonthly(month) {
  return request({
    url: '/summary/month-summary',
    method: 'get',
    params: {month: month}
  })
}


export function getAllMonth(query) {
  return request({
    url: '/summary/allMonth-summary',
    method: 'get',
    params: query,
  })
}



//获取周报时间段
export function getWeekList(query) {
  return request({
    url: 'time/list',
    method: 'get',
    params: query,
  })
}


//获取周报列表
export function getWeekReport(query) {
  return request({
    url: 'weekSummary/list',
    method: 'get',
    params: query,
  })
}
//添加周报
export function addWeekReport(data) {
  return request({
    url: 'weekSummary',
    method: 'post',
    data
  })
}

//根据userid查询是否填写周报
export function getWeekListById(data) {
  return request({
    url: `weekSummary/getInfo/${data.userId}?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
    method: 'get',
    // params:query
  })
}

//根据timeId查询周报
export function getWeekListByTimeId(timeid) {
  return request({
    url: `weekSummary/${timeid}`,
    method: 'get',
    // params:query
  })
}


//用户修改周报
export function editWeekReport(data) {
  return request({
    url: "weekSummary",
    method: 'put',
    data
    // params:query
  })
}

